<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateOrderActionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('order_actions', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('order_id');
            $table->integer('user_id');
            $table->string('order_status')->default('UNCONFIRMED');
            $table->tinyInteger('pay_status')->default(0);
            $table->tinyInteger('shipping_status')->default(0);
            $table->string('action', 50)->nullable();     // 操作名称
            $table->string('note', 255)->nullable();      // 备注
            $table->text('details')->nullable();              // 扩展，json格式
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('order_actions');
    }
}
